#ifndef PASSWORDDIALOG_H
#define PASSWORDDIALOG_H

#include <QDialog>
#include <QSettings>

// 前向声明
namespace Ui {
class PasswordDialog;
}

class PasswordDialog : public QDialog
{
    Q_OBJECT

public:
    explicit PasswordDialog(QWidget *parent = nullptr);
    ~PasswordDialog();
    
    bool isAuthenticated() const;

private slots:
    void onOkClicked();
    void onCancelClicked();

private:
    void loadPassword();
    bool verifyPassword(const QString &inputPassword);
    
    Ui::PasswordDialog *ui;
    QString correctPassword;
    bool authenticated;
    QSettings *settings;
};

#endif // PASSWORDDIALOG_H